
//- This Source Code Form is subject to the terms of the Mozilla Public
//- License, v. 2.0. If a copy of the MPL was not distributed with this
//- file, You can obtain one at http://mozilla.org/MPL/2.0/.
//-
//- Copyright (c) 2021-present Kaleidos Ventures SL

doctype html

div.wrapper.roles(
    tg-github-webhooks
    ng-controller="GithubController as ctrl",
    ng-init="section='admin'"
)
    tg-project-menu
    sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties")
        include ../includes/modules/admin-menu
    sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-github")
        include ../includes/modules/admin-submenu-third-parties

    section.main.admin-common.admin-third-parties
        include ../includes/components/mainTitle

        form
            fieldset
                label(for="secret-key", translate="ADMIN.THIRD_PARTIES.SECRET_KEY")
                input(
                    id="secret-key"
                    type="text"
                    name="secret-key"
                    ng-model="github.secret"
                    placeholder="{{'ADMIN.THIRD_PARTIES.SECRET_KEY' | translate}}"
                )

            fieldset
                .select-input-text(tg-select-input-text)
                    div
                        label(for="payload-url", translate="ADMIN.THIRD_PARTIES.PAYLOAD_URL")
                        .field-with-option
                            input(
                                id="payload-url"
                                type="text"
                                name="payload-url"
                                readonly="readonly"
                                ng-model="github.webhooks_url"
                                placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
                            )
                            .option-wrapper.select-input-content(title="{{'COMMON.COPY_TO_CLIPBOARD' | translate}}")
                                tg-svg(svg-icon="icon-clipboard")

            button.btn-small(
                variant="primary"
                type="submit"
                title="{{'COMMON.SAVE' | translate}}"
                translate="COMMON.SAVE"
            )

        a.help-button(
            href="https://docs.taiga.io/integrations-github.html"
            target="_blank"
        )
            tg-svg(svg-icon="icon-question")
            span(translate="ADMIN.HELP")
